package utils;

import java.security.SecureRandom;

public class UIDGenerator {
	
    private static UIDGenerator globalUIDGenerator;
    
    private SecureRandom random;

    
    private UIDGenerator() {
        this.random = new SecureRandom();
    }

    public static synchronized UIDGenerator getInstance() {
        if (globalUIDGenerator == null) {
            globalUIDGenerator = new UIDGenerator();
        }
        return globalUIDGenerator;
    }

    
    public String getKey() {
        String key = "" + System.currentTimeMillis() + Long.toHexString(random.nextInt());
        return key;
    }
    
}